App({
    onLaunch: function() {
        var t = this;
        wx.getSystemInfo({
            success: function(a) {
                t.globalData.platform = a.platform, t.globalData.windowWidth = a.windowWidth, t.globalData.windowHeight = a.windowHeight, 
                t.globalData.screenHeight = a.screenHeight, t.globalData.statusBarHeight = a.statusBarHeight, 
                t.globalData.titleBarHeight = "android" === a.platform ? 48 : 44, t.initDiySize();
            }
        }), this.checkLogin(), this.checkForUpdate();
    },
    checkForUpdate: function() {
        if (wx.canIUse("getUpdateManager")) {
            var t = wx.getUpdateManager();
            t.onCheckForUpdate(function(a) {
                a.hasUpdate && (t.onUpdateReady(function() {
                    wx.showModal({
                        title: "新版本提示",
                        content: "新版本已经准备好，是否重启应用？",
                        success: function(a) {
                            a.confirm && t.applyUpdate();
                        }
                    });
                }), t.onUpdateFailed(function() {
                    wx.showModal({
                        title: "新版本提示",
                        content: "新版本已经上线啦，请您删除当前小程序，然后在WHOSSSMADE公众号里或搜索whosssmade小程序重新打开"
                    });
                }));
            });
        } else wx.showModal({
            title: "更新提示",
            content: "当前微信版本过低，无法使用小程序更新功能，请升级到最新微信版本后重试"
        });
    },
    checkLogin: function() {
        var t = void 0;
        try {
            t = wx.getStorageSync("user");
        } catch (t) {}
        var a = !1, i = "", e = (t = t.constructor === Object ? t : {}).user_token;
        "string" == typeof e && e && (a = !0, i = e), this.globalData.isLogin = a, this.globalData.authToken = i, 
        this.globalData.user = t;
    },
    loseSession: function() {
        try {
            wx.removeStorageSync("user");
        } catch (t) {}
        this.globalData.isLogin = !1, this.globalData.authToken = "", this.globalData.user = {};
    },
    initDiySize: function() {
        var t = 312 * this.globalData.windowWidth / 750, a = this.globalData.windowWidth, i = this.globalData.screenHeight, e = this.globalData.titleBarHeight, o = this.globalData.statusBarHeight, l = i - e - o - t, h = a, n = 785 * h / 596, s = n;
        n > l ? a = (s = l) >= h ? h : l : t = i - e - o - s;
        var g = 912 * s / 1636, d = 297 * g / 420, r = 444 * g / 912, c = 410 * g / 912, u = 22 * g / 71, p = 28 * g / 71, w = (a - d) / 2;
        this.globalData.diyPageBottomHeight = t;
        var f = Math.round(100 * d) / 100, D = Math.round(100 * g) / 100, b = Math.round(100 * r) / 100, m = Math.round(100 * c) / 100, H = Math.round(100 * w) / 100, y = Math.round(100 * u) / 100, S = Math.round(100 * p) / 100, M = b / s * 100 + "%", T = m / s * 100 + "%";
        this.globalData.diySize = {
            stageWidth: a,
            stageHeight: s,
            front: {
                1: {
                    width: f,
                    height: D,
                    top: b,
                    left: H,
                    imgTop: M
                },
                2: {
                    width: f,
                    height: Math.round(4 * f / 5),
                    top: m,
                    left: H,
                    imgTop: T
                }
            },
            back: {
                1: {
                    width: f,
                    height: D,
                    top: y,
                    left: H,
                    imgTop: 13 / 71 * 100 + "%"
                },
                2: {
                    width: f,
                    height: D,
                    top: S,
                    left: H,
                    imgTop: 16 / 71 * 100 + "%"
                }
            }
        };
    },
    globalData: {
        statusBarHeight: 20,
        titleBarHeight: 44,
        windowWidth: 375,
        windowHeight: 667,
        screenHeight: 667,
        isLogin: !1,
        authToken: "",
        diySize: {
            stageWidth: 375,
            stageHeight: 494,
            front: {
                1: {
                    width: 297,
                    height: 420,
                    top: 0,
                    left: 0,
                    imgTop: "0%"
                },
                2: {
                    width: 297,
                    height: 297,
                    top: 0,
                    left: 0,
                    imgTop: "0%"
                }
            },
            back: {
                1: {
                    width: 297,
                    height: 420,
                    top: 0,
                    left: 0,
                    imgTop: "0%"
                },
                2: {
                    width: 297,
                    height: 420,
                    top: 0,
                    left: 0,
                    imgTop: "0%"
                }
            }
        },
        diyScale: 5,
        editAddressItem: null,
        chooseAddressItem: null,
        diyDrewClassify: [],
        diyDrewList: {},
        chooseCouponItem: null,
        isEditOrder: !1,
        defaultClothingData: null,
        user: {},
        diyPageBottomHeight: 156,
        isNeedToUpdateCartData: !0,
        productSkuData: null,
        pictureDetailList: null,
        platform: "devtools",
        hadShowUploadTip: !1,
        cartPageData: {
            list: null,
            isEdit: !1,
            selectedList: [],
            isSelectedAll: !1,
            selectedTotal: 0,
            totalPrice: 0,
            total: 0,
            totalShirt: 0,
            page: 1,
            isFirstLoading: !0
        },
        deviceId: ""
    }
});